//#ifndef		__ESTOOLS_H__
//#define		__ESTOOLS_H__

//#ifdef		__cplusplus
//extern		"C"	{
//#endif

//void	TrimLeft(char * pSource,char * pTarget);
//void	TrimRight(char * pSource,char * pTarget);
//void	TrimAll(char * pSource,char * pTarget);

//long	ExtractKey(char * pSource,char * pKey,char * pValue);
//long	ExtractCommand(char * pSource,char * pCommand);
//long	ExtractString(char * pSource,char chtok,char * pString);
//long	SplitKey(char * pSource,char * pKey,char * pValue);

//void	ShowCurTime();
//void	GetCurTime(char * pTime);
//void	GetCurDate(long *nYear,long *nMon,long *nDay);

//long	EncodeKey(unsigned char * pKeyCode,unsigned char * pKeyData);
//long	DecodeKey(unsigned char * pKeyData,unsigned char * pKeyCode);

//long	ExecCommand(char * pHostName,char * pUserName,char * pPassword,
//			char * pCommand);

//#ifdef		__cplusplus
//				}
//#endif

//#endif

#ifndef	_ESTOOLS_H_
#define	_ESTOOLS_H_

#include        <sys/time.h>
#include	"stdlib.h"
#include	"time.h"
#include	"stdio.h"
#include 	"stdlib.h"
#include 	"fcntl.h"
#include 	"stdio.h"
#include 	"sys/types.h"
#include 	"sys/stat.h"
#include 	"signal.h"
#include 	"sys/types.h"
#include 	"errno.h"
#include	"string.h"

#ifndef		COMMANDCHAR
#define		COMMANDCHAR ';'
#endif

#ifndef		SPLITCHAR
#define		SPLITCHAR '='
#endif

#ifdef DLLEXPORT
#undef DLLEXPORT
#endif

#ifdef ESTOOLS_EXPORTS
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#ifdef	_WIN32
#pragma comment(lib,"estools.lib")
#endif

#endif


extern "C" DLLEXPORT void TrimAll(char * pSource,char * pTarget);
extern "C" DLLEXPORT void TrimLeft(char * pSource,char * pTarget);
extern "C" DLLEXPORT long ExtractKey(char * pSource, char * pKey, char * pValue);
extern "C" DLLEXPORT void TrimRight(char * pSource,char * pTarget);
extern "C" DLLEXPORT long ExtractString(char * pSource, char chtok,char * pString);
extern "C" DLLEXPORT long ExtractCommand(char * pSource, char * pCommand);
extern "C" DLLEXPORT void	ShowCurTime();
extern "C" DLLEXPORT void GetCurTime(char * pTime);
extern "C" DLLEXPORT void GetCurTimeStr(char * pTime);
extern "C" DLLEXPORT void GetCurDateStr(char * pTime);
extern "C" DLLEXPORT void GetCurDate(long * nYear,long * nMon,long *nDay);
extern "C" DLLEXPORT long SplitKey(char * pSource, char * pKey, char * pValue);
extern "C" DLLEXPORT void    GetNowDateStr(char * pTime);
extern "C" DLLEXPORT void    GetNowTimeStr(char * pTime);
extern "C" DLLEXPORT void    GetYesterdayDateStr(char * pTime);

extern "C" DLLEXPORT char ** CreateStrList(char * pSource,char ch);
extern "C" DLLEXPORT void	DeleteStrList(char **pStrList);
extern "C" DLLEXPORT long	GetStrListCount(char **PStrList);
extern "C" DLLEXPORT void	ChopStr(char * pSource,char chChop);


typedef  struct timeval  timeval_t;

extern "C" DLLEXPORT double difftimeval(const struct timeval *tv1, const struct timeval *tv2);
extern "C" DLLEXPORT char *strftimeval(const struct timeval *tv, char *buf);
extern "C" DLLEXPORT char *getstimeval(char *buf);

extern "C" DLLEXPORT char* SGetCurDate(char* pszDate, char* pszFmt);

extern "C" DLLEXPORT char* SGetCurTime(char* pszTime, char* pszFmt);

extern "C" DLLEXPORT char* SGetCurTailTime(char* pszTime, char* pszFmt);

#endif
